<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
   <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>嘉童游乐中心-商品定价清单</title>
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script type="text/javascript">
		//保存门店的定价信息
		function savePriceForBranch(status){
			$("#status").val(status);
			if(checkIsNull($("#branchPrice").val())){
				alertWarning("门店价格不能为空");
				return;
			}
			$.messager.confirm('温馨提示', status=="1"?"您确定要保存吗?":"您确定要提交吗?", function(flag) {
				if(flag){
					$("#hide_loading").show();
					$.ajax({
						url:"${basePath}scmInvocing/priceManager/updatePriceForBranch.shtml",
						data:$("#saveForBranch").serialize(),
						type:"post",
				 		async:false,
				 		dataType:"text",
				 		error : function(XMLHttpRequest) {
		  	 				ajaxError(XMLHttpRequest);
		  	 			},
				 		success:function(result){
				 				$("#hide_loading").hide();
				 				if(result=="success"){
				 					window.location.href="${basePath}scmInvocing/priceManager/forwardToList.shtml";
				 				}
				 		}
					});
				}
			});
			
		}
		/*验证价格是否合理**/
		function  checkThePrice(thisObj){
			var  price=$(thisObj).val();
			if(!checkIsNull(price)){
				if(!checkIsDouble(price)){
					alertWarning("请输入正确的价格!");
					$(thisObj).val("");
				}
			}
		}
</script>
</head>
<body class="bg">
<div class="content m_auto">
 <div class="content_l mt10">
    	<ul>
    		<shiro:hasPermission name="scmInvocing/productInfo/forwardToProductInfo.shtml">
    				  <li ><a href="${basePath}scmInvocing/productInfo/forwardToProductInfo.shtml"><i class="nav_icon_b"></i><br>商品信息</a></li>
    		</shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/countUnit/forwardToUnitInfo.shtml">
    		 		<li><a href="${basePath}scmInvocing/countUnit/forwardToUnitInfo.shtml"><i class="nav_icon_b"></i><br>单位设置</a></li>
    		 </shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/supplier/forwardToSupply.shtml">
    		 		   <li><a href="${basePath}scmInvocing/supplier/forwardToSupply.shtml"><i class="nav_icon_a"></i><br>供应商信息</a></li>
    		 </shiro:hasPermission>
    		  <shiro:hasPermission name="scmInvocing/priceManager/forwardToList.shtml">
    		 		  <li class="content_hover"><a href="${basePath}scmInvocing/priceManager/forwardToList.shtml"><i class="nav_icon_f"></i><br>价格管理</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPurOrder/findInvoPurOrder.shtml">
            	  <li><a href="${basePath}scmInvocing/scmPurOrder/findInvoPurOrder.shtml"><i class="nav_icon_b"></i><br>采购订单</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPayForm/findInvoOrderPay.shtml">
           		   <li><a href="${basePath}scmInvocing/scmPayForm/findInvoOrderPay.shtml"><i class="nav_icon_b"></i><br>付款申请</a></li>
    		 </shiro:hasPermission>
    </ul>
    </div>
    <div class="content_r mt10">
    	<div class="p20">
    	<form id="saveForBranch">
    	<input type="hidden" name="status" id="status" value="" >
    	<input type="hidden" name="fkBranId" id="fkBranId" value="${branId}" >
    	<input type="hidden" name="fkPrdId" id="fkPrdId" value="${entity.pkPrdId}" >
    	<input type="hidden" name="pkPriceId" id="pkPriceId" value="${entity.pkPriceId}" >
    	<div class="file_single_dl f14 fixed">
             <dl class="fixed"  >
                <dd ><label><h1>商品定价清单</h1></label></dd>
            </dl>
            <dl class="fixed"  >
                <dd><label>定价人：</label>${entity.userName}</dd> <dd ><label>定价日期：</label>${entity.orderTime}</dd>
                <dd><label>定价单位：</label>${entity.branName}</dd>
            </dl>
       		 <dl class="fixed"  >
                <dd ><label>商品编号：</label> <input type="text" class="iput_t w200" value="${entity.pkPrdId}" disabled>  </dd> 
                <dd ><label>商品名称：</label> <input type="text" class="iput_t w200" value="${entity.prdName}" disabled>  </dd>
            </dl>
      		 <dl class="fixed"  >
                <dd ><label> 计量单位：</label> <input type="text" class="iput_t w200" value="${entity.unitName}" disabled>  </dd> 
                <dd ><label>商品规格：</label> <input type="text" class="iput_t w200" value="${entity.prdSpec}" disabled>  </dd>
            </dl>
            <dl class="fixed"  >
                <dd ><label> 商品分类：</label> <input type="text" class="iput_t w200" value="${entity.cateName}" disabled>  </dd> 
                <dd ><label>市场销售价：</label> <input type="text" class="iput_t w200" name="marketPrice"  id="marketPrice"  value="${entity.marketPrice}" disabled>  </dd>
            </dl>
              <dl class="fixed"  >
                 <dd ><label> 允许分店定价：</label> <div class="uboxstyle">
                			<c:choose>
                					<c:when test="${entity.isAllow=='1'}">
                							  <!-- <select name="isAllow" id="isAllow" >
                                 					<option value="1" selected="selected">是</option> 
                                 					<option value="0">否</option> 
                            				 </select>	 -->
                            				 <input type="text"   class="iput_t w200"   disabled="disabled"  value="是"/>
                					</c:when>
                					<c:otherwise>
                						<!-- <select name="isAllow" id="isAllow" >
                                			 	<option value="1">是</option> 
                                 				<option value="0" selected="selected">否</option> 
                             			</select> -->
                             			<input   class="iput_t w200" type="text"  disabled="disabled"   value="否" />
                					</c:otherwise>
                			</c:choose>
                         </div></dd> 
                        <dd ><label>分店价格：</label> <input type="text" class="iput_t w200"  name="branchPrice" id="branchPrice"   onblur="checkThePrice(this);"  value="${entity.branchPrice}"  >  </dd>
            </dl>
            <dl class="fixed"   >
             <dd ><label>总部价格：</label> <input type="text" class="iput_t w200"  name="headPrice"   value="${entity.headPrice}" disabled  >  </dd>
            </dl>
             <dl class="fixed"   >
              <dd><label>备注：</label><textarea class="textare w200" name="comments">${entity.comments} </textarea></dd>
            </dl>
        </div>
        </form>
            <div class="btm_btn mt10">
                    <dl>
                        <dd><input type="button" onclick="savePriceForBranch('1');" value="保存" class="btn"></dd>
                        <dd><input type="button" onclick="savePriceForBranch('2');" value="提交" class="btn"></dd>
                        <dd><input class="btn" type="button" value="返回" onclick="javascript:window.location.href='${basePath}scmInvocing/priceManager/forwardToList.shtml' "></dd>
                    </dl>
            </div>
            <div id="hide_loading">
					<div class="loading"></div>    
				    <div class="loading_bg" ></div>	
			</div>
        </div>
    </div>
</div>
</body>
</html>
